import sphRequest from '@/request/sph'
import zhaiRequest from '@/request/zhai'

// 首页三级分类
export const getBaseCategoryList = function () {
  return sphRequest('/product/getBaseCategoryList')
}

// 商品排行
export const getRankList = function () {
  return zhaiRequest('/rankList')
}

// 商品排行
export const getGoodsList = function (type) {
  return zhaiRequest('/goodsList/' + type)
}

// 获取猜你喜欢的数据
export const getLikeList = function (pageNo, pageSize) {
  return zhaiRequest.get('/likeList', {
    params: {
      pageNo,
      pageSize,
    },
  })
}

// 获取楼层数据
export const getFloorList = function () {
  return zhaiRequest('/floorList')
}
// 搜索商品 /api/list
export const postSearchGoodsList = function (body) {
  return sphRequest.post('/list', body)
}

// 获取商品详情：/api/item/{ skuId }
export const getProductInfo = (id) => sphRequest.get('/item/' + id)

//获取加入购购物车成功
export const getCartInfoSuccess = function (id) {
  return sphRequest('/cartInfoSuccess', id)
}
